package org.java.innerClass01;

import org.java.innerClass.Destination;

/**
 * local inner class
 * 在方法的作用域内 创建一个完整的类
 * @author imaginedays
 *
 */
public class Parcel4 {

	public Destination dest(String s){
		class PDestination implements Destination{
			private String label;
			private PDestination(String whereTo){
				label = whereTo;
			}
			
			@Override
			public String readLabel() {
				return label;
			}
		}
		
		return new PDestination(s);
	}
	
	public static void main(String[] args) {
		Parcel4 p = new Parcel4();
		p.dest("ss");
	}

}
